package com.hyh.toyshopping.controller;


import com.hyh.toyshopping.model.Message;
import com.hyh.toyshopping.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @version 1.0
 * @BelongsProject:IntelliJ IDEA
 * @BelongsPackage:com.hyh.toyshopping.controller
 * @Author:hyhWTX
 * @ClassName:MessageController
 * @CreateTime:2022年-12月-18日 21:43
 * @Description: TODO (一句话描述以下该类的功能)
 */
@RestController
@RequestMapping("/message")
public class MessageController {
    @Autowired
    private MessageService MessageService;
    @GetMapping("/getAll")
    public List<Message> getAll(){
        return  MessageService.getAllMessage();
    }




    @PostMapping("/addmessage")
    public void addMessage(Message message){ MessageService.addMessage(message);
    }
}
